#define ElemType int

typedef struct ListNode List_Node;

#include "common.h"

bool isSelfCrossing(int* distance, int distanceSize);

int main()
{
	return 0;
}

bool isSelfCrossing(int* distance, int distanceSize)
{
	for (int i = 3; i < distanceSize; i++) {
		if (i >= 3 && distance[i - 1] <= distance[i - 3] && distance[i] >= distance[i - 2])
			return true;
		if (i >= 4 && distance[i - 3] == distance[i - 1] && distance[i] + distance[i - 4] >= distance[i - 2])
			return true;
		if (i >= 5 && distance[i] + distance[i - 4] >= distance[i - 2] && distance[i - 1] + distance[i - 5] >= distance[i - 3] && distance[i - 2] > distance[i - 4])
			return true;
	}
	return false;
}
